# test01_func.py
import random
def exam():
    nums = [random.randint(1,100) for i in range(2)]
    nums.sort(reverse=True)  # [大, 小]
    fuhao = random.choice("+-")  # "+" or "-"
    if fuhao == "+":  # data: 正确答案
        data = nums[0] + nums[1]
    else:  # "-"
        data = nums[0] - nums[1] #suan:用户计算结果
    suan=int(input(f"{nums[0]}{fuhao}{nums[1]}:"))
    if suan == data:
        print("bingo~")
    else:
        print("Error, right answer:", data)
if __name__ == '__main__':
    exam()

